﻿using MediatR;
using T_settlement.Domain;
using T_settlement.Infrastructure.Interfacec;
using T_settlement.Read.API.Application.Command.PayMoneyCommand;

namespace T_settlement.Read.API.Application.CommandHandlers.PayMoneyCommandHandlers
{
    public class FanPayMoneyCommandHandlers:IRequestHandler<FanPayMoneyCommand,PayMoney>
    {
        private readonly IPayMoneyRepository payMoneyRepository;

        public FanPayMoneyCommandHandlers(IPayMoneyRepository payMoneyRepository)
        {
            this.payMoneyRepository = payMoneyRepository;
        }

        public async Task<PayMoney> Handle(FanPayMoneyCommand request, CancellationToken cancellationToken)
        {
            var list = await payMoneyRepository.GetModelAsync(request.PayMoneyId);
            return  list;
        }
    }
}
